﻿@model Tasks.UI.Models.TourGuide.EditModel
@{
    Layout = null;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>导游编辑</title>
    <link href="@Config.GetCssResourcePath("main.css")" rel="stylesheet" type="text/css" />
    <link href="@Config.GetCssResourcePath("table.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/themes/base/jquery.ui.all.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery-ui-1.8.11.min.js")" type="text/javascript"></script>
    <script src="/Scripts/ckeditor/ckeditor_basic.js" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/global.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.js")" type="text/javascript"></script>
    <script type="text/javascript">
        $().ready(function () {
            initProvince("#ProvinceID");
            initCity("#CityID");
            $("form").validate({
                showErrors: function (errorMap, errorList) {
                    $.Msg.errorTips("您的表单填写不完整:", 0, errorList);
                },
                rules: {
                    Name: "required"
                },
                messages: {
                    Name: "请输入姓名"
                },
                /* 获得焦点时不验证 */
                focusInvalid: false,
                onfocusout: false,
                onkeyup: false
            });

        })

        function goto(act) {
            $("#act").val(act);
            $("form").submit();
        }
       
    </script>
</head>
<body>
    @using (Html.BeginForm())
    {
        <input id="act" name="act" type="hidden" />
        @Html.HiddenFor(t => t.TourGuideID)
        <div id="container">
            <div class="navTitle">
                编辑导游信息
            </div>
            @Html.OutputMessage(Model.Message, Model.MessageType)
            <div id="horizontal">
                <div class="pageBody">
                    <table style="width: 100%;">
                        <tr>
                            <td style="width: 80px;">
                                <strong>姓&nbsp;&nbsp; 名：</strong>
                            </td>
                            <td style="width: 300px;">
                                @Html.TextBoxFor(t => t.Name)
                            </td>
                            <td style="width: 80px;">
                                <strong>性&nbsp;&nbsp; 别:</strong>
                            </td>
                            <td>
                                @Html.DropDownList("Sex", PageHelper.SexSelector(Model.Sex))
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <strong>手&nbsp;&nbsp; 机：</strong>
                            </td>
                            <td>
                                @Html.TextBoxFor(t => t.Mobile)
                            </td>
                            <td>
                                <strong>备用手机：</strong>
                            </td>
                            <td>
                                @Html.TextBoxFor(t => t.Mobile2)
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <strong>工作性质：</strong>
                            </td>
                            <td>
                                @{
                           IList<SelectListItem> workItem = PageHelper.GuideWorkItem();
                                }
                                @foreach (SelectListItem item in workItem)
                                {
                                    if (Model.WorkType != null)
                                    {


                                        if ((Model.WorkType.IndexOf(("," + item.Value.ToString()) + ",") != -1))
                                        {
                                    <input type="checkbox" checked="checked" name="WorkTypes" value="@item.Value"/>
                                        }
                                        else
                                        {
                                    <input type="checkbox" name="WorkTypes" value="@item.Value"/>
                                        }
                                    }
                                    else
                                    {
                                    <input type="checkbox" name="WorkTypes" value="@item.Value"/>
                                    }
                                    @item.Text
                                }
                            </td>
                            <td>
                                <strong>派团排序</strong>
                            </td>
                            <td>@Html.TextBoxFor(t => t.SNO)
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <strong>身 份 证：</strong>
                            </td>
                            <td>
                                @Html.TextBoxFor(t => t.IDCard)
                            </td>
                            <td>
                                <strong>管理费用：</strong>
                            </td>
                            <td>
                                @Html.TextBoxFor(t => t.ManageCharge)
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <strong>导 游 证：</strong>
                            </td>
                            <td>@Html.TextBoxFor(t => t.GuideNo)
                            </td>
                            <td>
                                <strong>领 队 证：</strong>
                            </td>
                            <td>
                                @Html.TextBoxFor(t => t.LearderNo)
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <strong>导游等级：</strong>
                            </td>
                            <td>
                                @Html.DropDownList("WorkLevel", PageHelper.WorkLevelSelector(Model.WorkLevel))
                                @Html.DropDownList("WorkTime", PageHelper.WorkTimeSelector(Model.WorkTime))
                            </td>
                            <td>
                                <strong>工作评价：</strong>
                            </td>
                            <td>
                                @Html.DropDownList("WorkAppraise", PageHelper.WorkAppraiseSelector(Model.WorkAppraise))
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <strong>语言种类：</strong>
                            </td>
                            <td colspan="3">
                                @foreach (DictValue item in Model.DictValue)
                                {
                                    if (Model.Language != null)
                                    {
                                        if (Model.Language.IndexOf(("," + item.ID.ToString()) + ",") != -1)
                                        {
                                    <input type="checkbox" checked="checked" name="Languages" value="@item.ID"/>
                                        }
                                        else
                                        {
                                    <input type="checkbox" name="Languages" value="@item.ID"/>
                                        }
                                    }
                                    else
                                    {
                                    <input type="checkbox" name="Languages" value="@item.ID"/>
                                    }
                                    @item.Name
                                }
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <strong>所在区域：</strong>
                            </td>
                            <td>
                                @Html.DropDownList("ProvinceID", PageHelper.ProvinceSelector(Model.ProvinceID))
                                @Html.DropDownList("CityID", PageHelper.CitySelector(Model.CityID, Model.ProvinceID))
                                @Html.DropDownList("AreaID", PageHelper.AreaSelector(Model.AreaID, Model.CityID))
                            </td>
                            <td>
                            </td>
                            <td>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <strong>简 &nbsp;&nbsp; 介：</strong>
                            </td>
                            <td colspan="3">
                                @Html.TextAreaFor(t => t.Remark, new { style = "width:99%;height:60px;" })
                            </td>
                        </tr>
                    </table>
                </div>
                <div class="BottomBtn" style="padding-left: 80px;">
                    <button class="big blue" type="button" onclick="goto('save')">
                        <span>保存</span></button>
                    <button class="big blue" type="button" onclick="goto('apply')">
                        <span>应用</span></button>
                    <button class="big blue" type="button" onclick="parent.closeCurrentTab()">
                        <span>关闭</span></button>
                </div>
            </div>
        </div>
    }
</body>
</html>
